<template>
  <div class="allCivil">
    <div class="header">
      <div class="titleContainer">
        <img :src="customerLogo" @click="handleLogoClick" />
        <span class="title" @click="handleLogoClick"> {{ customerDesc }} </span>
      </div>
      <div class="mine" @click.stop="handleMine" v-if="from!='ylIndex'">
        <span>我的</span>
        <img class="avator" src="https://img3.job1001.com/data_center/mine/avator.png" alt="" />
      </div>
    </div>
    <div class="contentContainer">
      <div class="experienceTime" v-if="dateType == '30' || dateType == '40'">
        体验时间
        <div class="time" v-if="leftTime < 86400">
          <div class="time-box">{{ timeHour }} 时</div>
          <div class="dot">
            <div></div>
            <div></div>
          </div>
          <div class="time-box">{{ timeMin }} 分</div>
          <div class="dot">
            <div></div>
            <div></div>
          </div>
          <div class="time-box">{{ timeSec }} 秒</div>
        </div>
        <div v-else class="time">剩余{{ leftDays }}天</div>
      </div>
      <div class="main">
        <div class="topNav">
          <div class="topNavItem">
            <div class="backBtn" title="返回" @click="handleBackBtnClick">
              <img :src="backBtn" alt="" />
            </div>
            <div class="navPositionName">岗位更多分类查找</div>
          </div>
        </div>
        <div class="mainContent">
          <el-scrollbar style="height: 100%">
            <div class="content">
              <div class="allDataOverview">
                <div class="yearBox">
                  <div class="year">距{{ year }}国考笔试</div>
                  <div class="leftNum" v-if="+countryCivilJobInfo.leftDay > 0">
                    还剩
                    <span class="red">{{ countryCivilJobInfo.leftDay }}</span>
                    天
                  </div>
                  <div class="over">已结束</div>
                </div>
                <div class="dataItem" v-for="item in allDataOverviewList" :key="item.name">
                  <div class="left" :style="{ background: `${item.leftBgc}` }"></div>
                  <div class="right" :style="{ background: `${item.rightBgc}` }">
                    <div class="value-box">
                      <span class="location" v-if="item.location">{{
                        item.location
                      }}</span>
                      <span class="value">{{ item.value }}</span>
                    </div>
                    <div class="name">{{ item.name }}</div>
                    <div class="desc" v-if="item.desc">{{ item.desc }}</div>
                  </div>
                </div>
              </div>
              <div class="tab">
                <div v-for="(item, index) in tabList" :key="index"
                  :class="['tabItem', activeTab === index ? 'active' : '']" @click="handleClickTab(index)">
                  {{ item }}
                </div>
              </div>
              <Transition name="fade">
                <div class="region" v-show="activeTab == 1">
                  <span :class="[
                      'regionTitle',
                      currentRegion.value === item.value ? 'active' : ''
                    ]" v-for="item in regionData" :key="item.value"
                    @click="handleClickRegion(item)">{{ item.label }}</span>
                </div>
              </Transition>
              <!-- <Transition name="fade">
                <div class="cityListBox" v-show="activeTab == 1">
                  <span
                    :class="[
                      'cityTitle',
                      currentCity.value === item.value ? 'active' : ''
                    ]"
                    v-for="item in cityList"
                    :key="item.value"
                    @click="handleClickCity(item)"
                    >{{ item.label }}</span
                  >
                </div>
              </Transition> -->
              <div class="dataOverview">
                <div class="item locationBox">
                  <div class="year">{{ year }}年国家公务员考试</div>
                  <div>
                    {{ activeTab == 0 ? '全国' : currentRegion.label }}岗位表
                  </div>
                </div>
                <div class="item" v-for="item in dataOverviewList" :key="item.name">
                  <div class="beforeIcon">
                    <img :src="item.beforeIcon" class="beforeIconClass" />
                  </div>
                  <div class="dataItemContent">
                    <span class="dataItemName">{{ item.name }}</span>
                    <span class="dataItemValue">{{ item.value }}</span>
                  </div>
                  <img :src="item.afterIcon" class="afterIconClass" />
                </div>
              </div>
              <div v-loading="loading">
                <div class="civilJobListBox" v-if="civilJobList.length > 0">
                  <div class="civilJobItem" v-for="item in civilJobList" :key="item.id"
                    @click="handleClickCivilJob(item)">
                    <el-tooltip class="item" effect="light" :content="item.depart" placement="top-start">
                      <div class="up">
                        {{ item.depart }}
                      </div>
                    </el-tooltip>
                    <div class="down">
                      <span>招考职位{{ item.jobNum }}个 </span>
                      <span>人数{{ item.jobPeopleNum }}人 </span>
                      <span>报名人数{{ item.peopleSubmitNum }}人</span>
                    </div>
                  </div>
                </div>
                <el-empty class="empty" description="暂无数据" v-else></el-empty>
              </div>
              <div class="footer">
                <div class="tips">
                  免责声明：提示广大考生，请报考前仔细阅读对应职位招录要求或联系招录单位确认，本职位检索系统提供内容仅供参考。
                </div>
                <el-pagination v-if="pData.total > 0" @size-change="handleSizeChange"
                  @current-change="handleCurrentChange" :current-page="pData.currentPage" :page-sizes="pData.pageSizes"
                  :page-size="pData.pageSize" :layout="pData.layout" :total="pData.total" background></el-pagination>
              </div>
            </div>
          </el-scrollbar>
        </div>
      </div>
    </div>
    <div class="rightSide">
      <img src="https://img3.job1001.com/data_center/images/elanAnimal.png" alt="" class="elanAnimal" />
      <div class="title">岗位年份</div>
      <div class="year">
        <span :class="[year == item ? 'active' : '']" v-for="item in yearList" :key="item"
          @click="handleSelectYear(item)">{{ item }}</span>
      </div>
    </div>
    <div class="glass" v-if="showGlass && (dateType == '30' || dateType == '40')">
      <div class="wx-card">
        <div class="title">
          <img :src="ztLogo" alt="" />
          <span>一览就业创业职业大全云平台</span>
        </div>
        <div class="desc">你的体验时间已到,如需续用,请联系工作人员</div>
        <div class="wx">
          <img :src="wxImg" alt="" v-if="wxImg" />
        </div>
        <div class="name">{{ contactName }}</div>
      </div>
    </div>
    
    <freeDialog />
  </div>
</template>

<script>
import freeDialog from "@/components/freeDialog";
import pagination from "@/mixin/pagination";
import { getDate } from "@/api/position-detail";
import {
  getCivilStat,
  getCivilDepart,
  getCivilSection,
  getCivilYear,
} from "@/api/civil-job";
import backBtn from "@/icons/backBtn.png";
import ztLogo from "@/assets/home/zt-logo.png";
import governmentIcon from "@/assets/home/governmentIcon.png";
import { regionData } from "@/utils/provinceData.js";

export default {
  mixins: [pagination],
  name: "Detail",
  components: {freeDialog},
  data() {
    return {
      from: "",
      regionData,
      governmentIcon,
      contactName: "",
      interval: null,
      dateType: "10",
      leftDays: 0,
      timeHour: "0",
      timeMin: "0",
      timeSec: "0",
      leftTime: 0,
      backBtn,
      ztLogo,
      wxImg: "",
      showGlass: false,
      SecretKey: "",
      pageTitle: "",
      token: "",
      isSuperToken: false,
      customerDesc: "",
      customerLogo: "",
      activeTab: 0,
      pData: {
        currentPage: 1,
        pageSizes: [10, 20, 50, 100],
        pageSize: 100,
        total: 0,
        layout: "total, prev, pager, next, sizes, jumper",
      },
      tabList: ["按机构性质查找", "按工作地点查找"],
      currentRegion: { label: "全国", value: "100000" },
      cityList: [],
      currentCity: {},
      yearList: [],
      allDataOverviewList: [
        {
          name: "-年国考报考人数",
          value: 0,
          leftBgc: "#0080FF",
          rightBgc: "#f4faff",
        },
        {
          name: "-年国考过审人数",
          value: 0,
          leftBgc: "#1FD0A3",
          rightBgc: "#F3FFFC",
        },
        {
          name: "报考人数最多地区",
          location: "--",
          value: 0,
          leftBgc: "#665CFE",
          rightBgc: "#F6F5FF",
        },
        {
          name: "报考人数最多岗位",
          desc: "--",
          value: "0：0",
          leftBgc: "#F4A700",
          rightBgc: "#FFFAEE",
        },
      ],
      dataOverviewList: [
        {
          name: "招考岗位",
          value: 454,
          beforeIcon:
            "https://img3.job1001.com/data_center/images/beforeIcon1.png",
          afterIcon:
            "https://img3.job1001.com/data_center/images/afterIcon1.png",
        },
        {
          name: "招录人数",
          value: 454,
          beforeIcon:
            "https://img3.job1001.com/data_center/images/beforeIcon2.png",
          afterIcon:
            "https://img3.job1001.com/data_center/images/afterIcon2.png",
        },
        {
          name: "报名人数",
          value: 1454,
          beforeIcon:
            "https://img3.job1001.com/data_center/images/beforeIcon3.png",
          afterIcon:
            "https://img3.job1001.com/data_center/images/afterIcon3.png",
        },
        {
          name: "最高竞争比",
          value: "23243:1",
          beforeIcon:
            "https://img3.job1001.com/data_center/images/beforeIcon4.png",
          afterIcon:
            "https://img3.job1001.com/data_center/images/afterIcon4.png",
        },
        {
          name: "入面平均分数线",
          value: "109",
          beforeIcon:
            "https://img3.job1001.com/data_center/images/beforeIcon5.png",
          afterIcon:
            "https://img3.job1001.com/data_center/images/afterIcon5.png",
        },
        {
          name: "过审人数",
          value: "2323",
          beforeIcon:
            "https://img3.job1001.com/data_center/images/beforeIcon6.png",
          afterIcon:
            "https://img3.job1001.com/data_center/images/afterIcon6.png",
        },
      ],
      civilJobList: [],
      requestFn: getCivilDepart,
      year: "",
      loading: false,
      countryCivilJobInfo: {},
    };
  },
  created() {
    //特殊情况(from=ylIndex)下不展示mineAvatar组件
    this.from = sessionStorage.getItem("from")||this.$route.query.from;

    this.year = this.$route.query.year;
    this.SecretKey = this.$route.query.SecretKey;
    if (localStorage.getItem("customerDesc")) {
      this.customerDesc = localStorage.getItem("customerDesc");
      document.title = this.customerDesc;
    }
    const extraJson = localStorage.getItem("extra");
    if (extraJson) {
      const extra = JSON.parse(extraJson);
      this.customerLogo = extra.icon ? extra.icon : this.governmentIcon;
    } else {
      this.customerLogo = this.governmentIcon;
    }

    const superToken = localStorage.getItem("superToken");
    if (superToken) {
      this.pageTitle = localStorage.getItem("customerName");
    } else {
      this.pageTitle = "职神籍";
    }
    this.currentRegion = this.regionData[0];
    this.cityList = [
      { label: `${this.currentRegion.label}全部职位`, value: "" },
      ...this.currentRegion.children,
    ];
    this.currentCity = this.cityList[0];
    this.getCivilYearFn();
    this.getDateFn();
    this.getCountryCivilStatFn();
    this.getStateCivilStatFn();
    this.getData();
  },
  methods: {
    handleSelectYear(item) {
      this.year = item;
      this.getCountryCivilStatFn();
      this.getStateCivilStatFn();
      this.getData();
    },
    async getCivilYearFn() {
      const res = await getCivilYear();
      if (res.code == 200) {
        if (res.data.length <= 0) return;
        const temp = [];
        res.data.forEach((item) => {
          temp.push(item.year);
        });
        this.yearList = temp.slice(0, 5); // 最多展示5年
      }
    },
    async getCountryCivilStatFn() {
      const params = {
        year: this.year,
        regionId: "100000", // 头部数据写死全国
        regionLevel: 0,
      };
      const res = await getCivilStat(params);
      if (res.code == 200) {
        this.countryCivilJobInfo = res.data;
        this.allDataOverviewList[0].name = `${this.year}年国考报考人数`;
        this.allDataOverviewList[0].value = res.data.peopleSubmitNum || "-";
        this.allDataOverviewList[1].name = `${this.year}年国考过审人数`;
        this.allDataOverviewList[1].value = res.data.peopleQualifiedNum || "-";
        this.allDataOverviewList[2].value = JSON.parse(
          res.data.extra
        ).maxSubNum;
        this.allDataOverviewList[2].location = JSON.parse(
          res.data.extra
        ).maxSubRegion;
        let competitionRatio = res.data.competitionRatio
          ? res.data.competitionRatio.replace(":", " : ")
          : "-";
        this.allDataOverviewList[3].value = competitionRatio;
        this.allDataOverviewList[3].desc = res.data.civilPosition
          ? res.data.civilPosition.jobName
          : "-";
      }
    },
    async getStateCivilStatFn() {
      const params = {
        year: this.year,
        // 如果是按机构性质查找，则是查询全国的数据
        regionId: this.activeTab == 0 ? "100000" : this.currentRegion.value,
        regionLevel: 0,
      };
      const res = await getCivilStat(params);
      if (res.code == 200) {
        this.dataOverviewList[0].value = this.checkString(res.data.jobNum);
        this.dataOverviewList[1].value = this.checkString(
          res.data.jobPeopleNum
        );
        this.dataOverviewList[2].value = this.checkString(
          res.data.peopleSubmitNum
        );
        let competitionRatio = res.data.competitionRatio
          ? res.data.competitionRatio.replace(":", " : ")
          : "-";
        this.dataOverviewList[3].value = competitionRatio;
        this.dataOverviewList[4].value = this.checkString(res.data.passScore);
        this.dataOverviewList[5].value = this.checkString(
          res.data.peopleQualifiedNum
        );
      }
    },
    checkString(val) {
      if (val == "0" || val == "0.0" || !val) {
        return "-";
      } else {
        return val;
      }
    },
    handleClickCivilJob(item) {
      const regionId =
        this.activeTab == 0 ? "100000" : this.currentRegion.value;
      let routeData = this.$router.resolve({
        path: `/government-civil-job-list?depart=${item.depart}&year=${item.year}&jobNum=${item.jobNum}&jobPeopleNum=${item.jobPeopleNum}&regionId=${regionId}&from=${this.from}`,
      });
      window.open(routeData.href, "_blank");
    },
    getData() {
      this.loading = true;
      const params = {
        year: this.year,
        pageNo: this.pData.currentPage,
        pageSize: this.pData.pageSize,
      };
      // 按照地点查找要多一个地点的入参和层级入参
      if (this.activeTab == 1) {
        params.regionId = this.currentRegion.value;
        params.regionLevel = 0;
      }
      this.requestFn(params)
        .then((res) => {
          if (res.code == 200) {
            this.civilJobList = res.data;
            this.pData.total = res.pageparam.sums;
          } else {
            console.log(res);
          }
        })
        .catch((e) => {
          console.log(e);
        })
        .finally(() => {
          this.loading = false;
        });
    },
    handleClickRegion(item) {
      this.currentRegion = item;
      this.cityList = [
        { label: `${item.label}全部职位`, value: "" },
        ...item.children,
      ];
      this.currentCity = this.cityList[0];
      this.pData.currentPage = 1;
      this.getStateCivilStatFn();
      this.getData();
    },
    handleClickCity(item) {
      this.currentCity = item;
      this.pData.currentPage = 1;
      this.getStateCivilStatFn();
      this.getData();
    },
    handleClickTab(index) {
      if (this.activeTab == index) return;
      this.activeTab = index;
      this.requestFn = index == 0 ? getCivilDepart : getCivilSection;
      this.pData.currentPage = 1;
      this.getStateCivilStatFn();
      this.getData();
    },
    async getDateFn() {
      const params = {};
      const roleType = localStorage.getItem("roleType") || "10";
      if (roleType == "10") {
        //  学生
        params.roleType = roleType;
        params.personId = localStorage.getItem("personId") || "";
      } else {
        //老师
        params.saasId =
          JSON.parse(localStorage.getItem("userInfo")).admin_id ||
          "100000000000001";
      }
      const res = await getDate(params);
      if (res.code == 200) {
        this.dateType = res.data.resType;
        this.contactName = res.data.contactName || "";
        this.wxImg = res.data.contactQrCode;
        const backendTimeString = res.data.endTime;
        // 将时间字符串转换为Date对象
        const backendTime = new Date(backendTimeString);
        // 获取当前时间的Date对象
        const currentTime = new Date();
        // 计算两个时间之间的毫秒差异
        const differenceInMillis =
          backendTime.getTime() - currentTime.getTime();
        // 将毫秒转换为秒
        const differenceInSeconds = (differenceInMillis / 1000).toFixed(0);
        this.leftDays = (differenceInSeconds / 86400).toFixed(0);
        this.startCountdown(differenceInSeconds);
      }
    },
    startCountdown(seconds) {
      this.leftTime = seconds; // 设置剩余时间
      const updateTimer = () => {
        this.timeHour = Math.floor(this.leftTime / 3600)
          .toString()
          .padStart(2, "0");
        this.timeMin = Math.floor((this.leftTime % 3600) / 60)
          .toString()
          .padStart(2, "0");
        this.timeSec = (this.leftTime % 60).toString().padStart(2, "0");

        if (this.leftTime <= 0) {
          clearInterval(this.interval); // 使用 this.interval 来引用定时器
          this.interval = null; // 清除定时器引用
          if (this.dateType == "30" || this.dateType == "40") {
            this.showGlass = true; // 时间到了就展示蒙层
          }
          this.timeHour = "00";
          this.timeMin = "00";
          this.timeSec = "00";
        } else {
          this.leftTime--; // 减少剩余秒数
        }
      };

      this.interval = setInterval(updateTimer, 1000); // 将 interval 保存在组件的数据属性中
    },
    handleBackBtnClick() {
      if (this.from == "ylIndex") {
        this.$router.push({
          path: "/freehome",
          query: {
            from: "ylIndex",
          },
        });
        return;
      } 
      this.$store.dispatch("settings/changeSetting", {
        key: "showType",
        value: "civil",
      });
      this.$router.push({
        path: "/position",
        query: {
          superToken: this.$route.query.superToken || "",
          SecretKey: this.$route.query.SecretKey || "",
          customerName: this.$route.query.customerName || "",
        },
      });
    },
    handleLogoClick() {
      console.log('from',this.from);
      
      if (this.from == "ylIndex") {
        this.$router.push({
          path: "/freehome",
          query: {
            from: "ylIndex",
          },
        });
      } else {
        this.$store.dispatch("settings/changeSetting", {
          key: "showType",
          value: "position",
        });
        this.$router.push({
          path: "/position",
          query: {
            superToken: this.$route.query.superToken || "",
            SecretKey: this.$route.query.SecretKey || "",
            customerName: this.$route.query.customerName || "",
          },
        });
      }
    },
    handleMine() {
      this.$router.push({
        path: "/mine",
        query: {
          id: this.$route.query.id,
          superToken: this.$route.query.superToken || "",
          SecretKey: this.$route.query.SecretKey || "",
          customerName: this.$route.query.customerName,
        },
      });
    },
  },
};
</script>
<style scoped lang="scss">
::v-deep .el-scrollbar__wrap {
  overflow-x: hidden;
}
.allCivil {
  position: relative;
  background: #f7f8fa;
  height: 100%;
  min-width: 1190px;
  .rightSide {
    position: fixed;
    right: 2px;
    top: 50%;
    z-index: 999;
    width: 52px;
    border-radius: 100px;
    background: linear-gradient(180deg, #ffe8d6 0%, #ffffff 50%);
    box-shadow: 0px 2px 10px 0px rgba(52, 122, 206, 0.5);
    .elanAnimal {
      position: absolute;
      top: -24px;
      left: 2px;
      width: 48px;
      height: 30px;
    }
    .title {
      font-weight: 600;
      font-family: PingFang-SC, PingFang-SC;
      font-size: 15px;
      color: #222222;
      padding: 16px 10px 8px 10px;
    }
    .year {
      display: flex;
      flex-direction: column;
      justify-content: center;
      text-align: center;
      margin-bottom: 14px;
      span {
        padding: 5px 0;
        color: #bcbcbc;
        font-size: 14px;
        cursor: pointer;
      }
      .active {
        font-size: 14px;
        color: #d5413d;
        font-weight: 600;
      }
    }
  }
  .glass {
    width: 100%;
    height: 100%;
    background: rgba(22, 22, 22, 0.6);
    backdrop-filter: blur(3px);
    position: absolute;
    top: 0;
    z-index: 9999;
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding-top: 20%;
    .wx-card {
      width: 361px;
      height: 316px;
      background-image: url("../../assets/home/wx-bg.png");
      background-size: 100% 100%;
      padding: 23px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      .title {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin-bottom: 20px;
        img {
          width: 28px;
          height: 28px;
        }
        span {
          font-weight: 800;
          font-size: 16px;
          color: #141416;
        }
      }
      .desc {
        margin-bottom: 19px;
      }
      .wx {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin-bottom: 15px;
        background-color: #ffffff;
        padding: 3px 3px 4px 4px;
        border-radius: 4px;
        img {
          width: 148px;
          height: 148px;
        }
      }
      .name {
        font-family: PingFang-SC, PingFang-SC;
        font-weight: bold;
        font-size: 15px;
        color: #333333;
      }
    }
  }
  .header {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 57px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(7px);
    background-size: 100% 57px;
    z-index: 2;
    .titleContainer {
      display: flex;
      align-items: center;
      padding-left: 25px;
      color: #fff;
      font-size: 17px;
      line-height: 24px;
      letter-spacing: 2px;
      .title {
        font-family: "title-home-font";
        cursor: pointer;
        max-width: 26vw;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-inline-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
      }
      img {
        height: 24px;
        width: auto;
        cursor: pointer;
        margin-right: 5px;
      }
    }
    .mine {
      color: #fff;
      cursor: pointer;
      display: flex;
      align-items: center;
      font-size: 14px;
      .avator {
        height: 24px;
        width: 24px;
        margin: 0 24px 0 8px;
        border-radius: 50%;
        overflow: hidden;
      }
    }
  }
  .contentContainer {
    width: 100%;
    height: 100%;
    padding-top: 52px;
    display: flex;
    background: url("../../assets/home/back.png") no-repeat;
    flex-direction: column;
    background-size: 100.1% auto;
    align-items: center;
    min-width: 1375px;
    .experienceTime {
      height: 28px;
      z-index: 3;
      position: absolute;
      top: 16px;
      right: 110px;
      display: flex;
      flex-direction: row;
      align-items: center;
      color: #ffffff;
      .time {
        margin-left: 9px;
        display: flex;
        flex-direction: row;
        align-items: center;
        .time-box {
          width: 56px;
          height: 28px;
          padding: 4px 8px; /* 内边距 */
          border: 1px solid #5e6d84; /* 边框 */
          border-radius: 4px; /* 圆角 */
          box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); /* 阴影 */
          margin: 0 4px;
          font-family: D-DIN-PRO-500-Medium;
          font-weight: bold;
          font-size: 15px;
          color: #ffffff;
        }
        .dot {
          height: 18px;
          display: flex;
          flex-direction: column;
          justify-content: space-evenly;
          div {
            width: 4px;
            height: 4px;
            background: #ffffff;
            border-radius: 50%;
          }
        }
      }
    }
    .main {
      height: calc(100% - 25px);
      position: relative;
      border-radius: 20px;
      margin-top: 24px;
      background-color: white;
      width: calc(100vw - 34px);
      min-width: 1375px;
      display: flex;
      flex-direction: column;
      .topNav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 60px;
        padding: 0 16px;
        .topNavItem {
          display: flex;
          width: 100%;
        }
        .topNavItemRight {
          display: flex;
          align-items: center;
          padding-right: 65px;
        }
        .backBtn {
          width: 36px;
          height: 36px;
          margin-right: 16px;
          cursor: pointer;
          img {
            width: 36px;
            height: 36px;
          }
        }
        .navPositionName {
          font-size: 18px;
          font-family: PingFangSC-Medium, PingFang SC;
          font-weight: 600;
          color: #222222;
          line-height: 28px;
          padding: 3px 16px 0 24px;
          margin: 0 -16px 0 -23px;
          width: 100%;
          border-bottom: 1px solid #cfd8f5;
        }
      }
      .mainContent {
        width: 100%;
        height: calc(100% - 60px);
        box-shadow: 0px 24px 32px -22px #d7e3f8 inset;
        .content {
          color: #222222;
          font-size: 13px;
          font-family: PingFangSC-Regular;
          display: block;
          flex: 1;
          height: calc(100% - 150px);
          min-width: 1200px;
          padding: 24px 24px 0 24px;
          .allDataOverview {
            display: flex;
            margin-bottom: 10px;
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            .yearBox {
              padding: 18px;
              border-radius: 8px;
              border: 1px solid #eaedf7;
              .year {
                font-family: PingFang-SC, PingFang-SC;
                font-weight: bold;
                font-size: 16px;
                color: #333333;
                padding-bottom: 8px;
              }
              .leftNum {
                font-family: PingFang-SC, PingFang-SC;
                font-weight: 800;
                font-size: 24px;
                color: #333333;
                .red {
                  font-family: D-DIN-PRO-800-ExtraBold;
                  font-weight: 600;
                  color: #d5413d;
                  font-size: 30px;
                }
              }
              .over {
                font-family: PingFang-SC, PingFang-SC;
                font-weight: 800;
                font-size: 24px;
                color: #d5413d;
                line-height: 33px;
              }
            }
            .dataItem {
              display: flex;
              border-radius: 8px;
              border: 1px solid #eaedf7;
              .left {
                width: 6px;
                height: 100%;
                margin-left: -2px;
                border-radius: 2px;
              }
              .right {
                flex: 1;
                display: flex;
                flex-direction: column;
                padding: 18px 18px 0 18px;
                border-radius: 8px;
                overflow: hidden;
                .name,
                .desc {
                  font-family: PingFangSC, PingFang SC;
                  font-weight: 400;
                  font-size: 16px;
                  color: #666666;
                }
                .desc {
                  padding: 2px 0 4px 0;
                }
                .value-box {
                  margin-bottom: 12px;
                  .location {
                    font-family: PingFang-SC, PingFang-SC;
                    font-weight: 800;
                    font-size: 20px;
                    color: #333333;
                    margin-right: 18px;
                  }
                  .value {
                    font-family: D-DIN-PRO-800-ExtraBold;
                    font-weight: 600;
                    font-size: 24px;
                    color: #333333;
                    padding: 14px 0;
                  }
                }
              }
            }
          }
          .tab {
            width: 100%;
            margin-top: 48px;
            display: flex;
            justify-content: center;
            .tabItem {
              font-family: PingFang-SC, PingFang-SC;
              font-weight: bold;
              font-size: 16px;
              color: #000000;
              margin-right: 60px;
              padding-bottom: 6px;
              cursor: pointer;
              &:hover {
                color: #0b6eff;
                border-bottom: 2px solid #0b6eff;
              }
            }
            .active {
              color: #0b6eff;
              border-bottom: 2px solid #0b6eff;
            }
          }
          .region {
            margin-top: 18px;
            display: flex;
            flex-wrap: wrap;
            .regionTitle {
              flex-shrink: 0;
              margin: 12px 18px 0 0;
              font-size: 16px;
              color: #444;
              cursor: pointer;
              &:hover {
                color: #0b6eff;
              }
            }
            .active {
              color: #0b6eff;
            }
          }
          .cityListBox {
            margin-top: 18px;
            display: flex;
            flex-wrap: wrap;
            .cityTitle {
              flex-shrink: 0;
              margin: 12px 18px 0 0;
              padding: 6px 10px;
              font-size: 15px;
              color: #444;
              cursor: pointer;
              border: 1px solid #eaedf7;
              border-radius: 4px;
              &:hover {
                color: #0b6eff;
                border: 1px solid #0b6eff;
              }
            }
            .active {
              color: #0b6eff;
              border: 1px solid #0b6eff;
            }
          }
          .dataOverview {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 10px;
            margin: 20px 0 10px 0;
            .item {
              display: flex;
              align-items: center;
              justify-content: space-between;
              padding: 18px;
              border-radius: 8px;
              border: 1px solid #eaedf7;
              .beforeIcon {
                border-radius: 8px;
                margin-right: 12px;
                .beforeIconClass {
                  width: 44px;
                  height: 44px;
                }
              }
              .dataItemContent {
                display: flex;
                flex-direction: column;
                .dataItemName {
                  font-family: PingFangSC, PingFang SC;
                  font-weight: 400;
                  font-size: 14px;
                  color: #a2a5b3;
                  margin-bottom: 5px;
                }
                .dataItemValue {
                  font-family: D-DIN-PRO-800-ExtraBold;
                  font-weight: bold;
                  font-size: 24px;
                  color: #242f57;
                }
              }
              .afterIconClass {
                width: 44px;
                height: 44px;
                margin-left: auto;
              }
            }
            .locationBox {
              display: block;
              border-radius: 8px;
              background: #f4faff;
              font-family: PingFang-SC, PingFang-SC;
              font-weight: bold;
              font-size: 16px;
              .year {
                margin-bottom: 12px;
              }
            }
          }
          .civilJobListBox {
            display: grid;
            gap: 10px;
            .civilJobItem {
              border-radius: 8px;
              border: 1px solid #eaedf7;
              padding: 16px;
              cursor: pointer;
              .up {
                font-weight: 400;
                font-size: 15px;
                color: #000000;
                margin-bottom: 10px;
                text-overflow: ellipsis;
                white-space: nowrap;
                overflow: hidden;
              }
              .down {
                > span {
                  font-family: PingFangSC, PingFang SC;
                  font-weight: 400;
                  font-size: 13px;
                  color: #666666;
                  margin-right: 4px;
                }
              }
              &:hover {
                background: #f1f1f1;
                transform: translateY(-2px);
              }
            }
          }
          .footer {
            display: flex;
            justify-content: space-between;
            margin: 24px 0;
            .tips {
              width: 362px;
              height: 40px;
              font-family: PingFangSC, PingFang SC;
              font-weight: 400;
              font-size: 13px;
              color: #666666;
              line-height: 20px;
            }
            ::v-deep
              .el-pagination.is-background
              .el-pager
              li:not(.disabled).active {
              background-color: #0b6eff;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 600px) {
  .civilJobListBox {
    grid-template-columns: repeat(2, 1fr); /* 两列布局 */
  }
}
@media (min-width: 601px) and (max-width: 1469px) {
  .civilJobListBox {
    grid-template-columns: repeat(4, 1fr); /* 三列布局 */
  }
}
@media (min-width: 1470px) and (max-width: 1745px) {
  .civilJobListBox {
    grid-template-columns: repeat(5, 1fr); /* 三列布局 */
  }
}
@media (min-width: 1746px) {
  .civilJobListBox {
    grid-template-columns: repeat(6, 1fr); /* 三列布局 */
  }
}
</style>
